/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package EDT.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author ali
 */
public class PromoNivGradForm extends org.apache.struts.action.ActionForm {
    
    private String promotion;
    private String formation;
    private String periode;
    private int nbrperiode;
    private int groupe;

    @Override
    public String toString() {
        return "PromoNivGradForm{" + "promotion=" + promotion + ", formation=" + formation + ", periode=" + periode + ", nbrperiode=" + nbrperiode + ", groupe=" + groupe + '}';
    }

    public int getGroupe() {
        return groupe;
    }

    public void setGroupe(int groupe) {
        this.groupe = groupe;
    }
    
    public int getNbrperiode() {
        return nbrperiode;
    }

    public void setNbrperiode(int nbrperiode) {
        this.nbrperiode = nbrperiode;
    }

    public String getPeriode() {
        return periode;
    }

    public void setPeriode(String periode) {
        this.periode = periode;
    }
    

    /**
     * @return
     */
    public String getPromotion() {
        return promotion;
    }

    /**
     * @param string
     */
    public void setPromotion(String string) {
        promotion = string;
    }

    /**
     * @return
     */
    public String getFormation() {
        return formation;
    }

    /**
     * @param string
     */
    public void setFormation(String string) {
        formation = string;
    }

    /**
     * @return
     */
    
    
    
    /**
     *
     */
    public PromoNivGradForm() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * This is the action called from the Struts framework.
     *
     * @param mapping The ActionMapping used to select this instance.
     * @param request The HTTP Request we are processing.
     * @return
     */
    
    /*
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        if (getName() == null || getName().length() < 1) {
            errors.add("name", new ActionMessage("error.name.required"));
            // TODO: add 'error.name.required' key to your resources
        }
        return errors;
    }*/
    
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        
        /*
        if (getGrade() == null || getGrade().length() < 1) {
            errors.add("grade", new ActionMessage("error.grade.required"));
            // TODO: add 'error.name.required' key to your resources
        }*/
        /*
        if (getGrade().equalsIgnoreCase("master") && getNiveau().equalsIgnoreCase("n3") ) {
            errors.add("niveau", new ActionMessage("error.niveau.required"));
            // TODO: add 'error.name.required' key to your resources
        }*/
        
        
        return errors;
    }
    
}
